package com.ourteam.system.dao.impl;

import com.ourteam.system.dao.ISysRoleModuleRelateDAO;
import com.ourteam.system.dao.SysRoleModuleRelate;
import com.ourteam.system.dao.SysRoleModuleRelateDAOQueryBean;

import net.dao.AbstractSpringDAO;
import net.dao.DataAccessObjectHelper;

import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang.StringUtils;

import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;


/**
 * Template Name : DAO服务对象
 * Template Version : 1
 * Template Last Modfiy Date : Fri Nov 17 11:00:11 CST 2017
 * Auto Generate Date : 2018-07-31 15:13:37
  * Warning ! This file will be overwrite when regenerate !
  *
 */
public class AbstractSysRoleModuleRelateDAOJdbcImpl extends AbstractSpringDAO
    implements ISysRoleModuleRelateDAO {
    public static final String[] ENTITY_FIELDS = new String[] {
            Id, ModuleId, Remarks, RoleId, Status, ParentModuleId, DomainId,
            ModuleSortIndex, ModuleCode, DomainCode
        };
    public static final String[] ENTITY_PROPERTIES = new String[] {
            _DataObjectProperty.Id, _DataObjectProperty.ModuleId,
            _DataObjectProperty.Remarks, _DataObjectProperty.RoleId,
            _DataObjectProperty.Status, _DataObjectProperty.ParentModuleId,
            _DataObjectProperty.DomainId, _DataObjectProperty.ModuleSortIndex,
            _DataObjectProperty.ModuleCode, _DataObjectProperty.DomainCode
        };
    public static final String[] ENTITY_PK_FIELDS = new String[] { Id };
    public static final String[] ENTITY_AUTO_GEN_PK_FIELDS = new String[] { Id };
    public static final String[] ENTITY_UNIQUE_FIELDS = new String[] {  };
    private static String relatedJoinSQL = null;
    private static String basicFilterSQL = null;
    private DataAccessObjectHelper<SysRoleModuleRelate, SysRoleModuleRelateDAOQueryBean> daoHelper;
    private com.ourteam.system.dao.impl.AbstractSysModuleDAOJdbcImpl SysModuleDao;
    private com.ourteam.system.dao.impl.AbstractSysRoleDAOJdbcImpl SysRoleDao;

    public AbstractSysRoleModuleRelateDAOJdbcImpl() {
        super();
        daoHelper = new DataAccessObjectHelper<SysRoleModuleRelate, SysRoleModuleRelateDAOQueryBean>(this);
    }

    protected String getEntityName() {
        return EntityName;
    }

    protected String[] getEntityFields() {
        return ENTITY_FIELDS;
    }

    protected String[] getEntityProperties() {
        return ENTITY_PROPERTIES;
    }

    protected String[] getEntityPKFields() {
        return ENTITY_PK_FIELDS;
    }

    protected String[] getEntityAutoGenPKFields() {
        return ENTITY_AUTO_GEN_PK_FIELDS;
    }

    protected String[] getEntityUniqueFields() {
        return ENTITY_UNIQUE_FIELDS;
    }

    protected String getBaiscQueryFilter() {
        if (basicFilterSQL == null) {
            StringBuffer basicFilterSQLbuffer = new StringBuffer();

            basicFilterSQL = basicFilterSQLbuffer.toString();
        }

        return basicFilterSQL;
    }

    protected String getRelatedJoinSQL() {
        if (relatedJoinSQL == null) {
            StringBuffer relatedJoinSQLBuffer = new StringBuffer();

            relatedJoinSQLBuffer.append(" LEFT JOIN ")
                                .append(com.ourteam.system.dao.ISysModuleDAO.EntityName)
                                .append(" SYS_MODULE ");

            relatedJoinSQLBuffer.append(" ON ( ");

            relatedJoinSQLBuffer.append(StringUtils.replace(
                    com.ourteam.system.dao.ISysModuleDAO.Id,
                    com.ourteam.system.dao.ISysModuleDAO.EntityName + ".",
                    "SYS_MODULE."));
            relatedJoinSQLBuffer.append(" = ").append(ModuleId);

            relatedJoinSQLBuffer.append(" ) ");

            relatedJoinSQLBuffer.append(" LEFT JOIN ")
                                .append(com.ourteam.system.dao.ISysDomainDAO.EntityName)
                                .append(" SYS_DOMAIN ");

            relatedJoinSQLBuffer.append(" ON ( ");

            relatedJoinSQLBuffer.append(StringUtils.replace(
                    com.ourteam.system.dao.ISysDomainDAO.Id,
                    com.ourteam.system.dao.ISysDomainDAO.EntityName + ".",
                    "SYS_DOMAIN."));
            relatedJoinSQLBuffer.append(" = ").append(DomainId);

            relatedJoinSQLBuffer.append(" ) ");

            relatedJoinSQL = relatedJoinSQLBuffer.toString();
        }

        return relatedJoinSQL;
    }

    /**
         * Check Data Unique
         * @param aSysRoleModuleRelate
         * @throws Exception
         */
    public boolean checkIsUnique(SysRoleModuleRelate aSysRoleModuleRelate)
        throws Exception {
        if (aSysRoleModuleRelate == null) {
            return true;
        }

        List valueList = new ArrayList();

        List pkValueList = new ArrayList();

        pkValueList.add(aSysRoleModuleRelate.getId());

        return isUnique(valueList.toArray(new Object[valueList.size()]),
            pkValueList.toArray(new Object[pkValueList.size()]));
    }

    /**
     * Insert Data
     * @param aSysRoleModuleRelate
     * @throws Exception
     */
    public void insert(SysRoleModuleRelate aSysRoleModuleRelate)
        throws Exception {
        super.doInsert(aSysRoleModuleRelate);
    }

    /**
         * Batch Insert Datas
         * @param aSysRoleModuleRelate
         * @throws Exception
         */
    public void batchInsert(SysRoleModuleRelate[] aSysRoleModuleRelates)
        throws Exception {
        super.doBatchInsert(aSysRoleModuleRelates);
    }

    /**
         * Delete Data
         * @param  final long id         *
         * @throws Exception
         */
    public void delete(final long id) throws Exception {
        super.doDeleteById(new Object[] { new Long(id) });
    }

    /**
     * Delete Datas
     * @param queryBean
     * @throws Exception
     */
    public void delete(SysRoleModuleRelateDAOQueryBean queryBean)
        throws Exception {
        super.doDeleteByQuery(queryBean);
    }

    public void delete(SysRoleModuleRelate aSysRoleModuleRelate)
        throws Exception {
        delete(aSysRoleModuleRelate.getId());
    }

    /**
     * Update Data Selective
     * @param aSysRoleModuleRelate
     * @throws Exception
     */
    public void update(SysRoleModuleRelate aSysRoleModuleRelate)
        throws Exception {
        if (aSysRoleModuleRelate.getId() == 0) {
            throw new Exception(
                "Can not update object data whith out primary key value");
        }

        super.doUpdate(aSysRoleModuleRelate);

        SysRoleModuleRelate tempObj = findById(aSysRoleModuleRelate.getId());

        if (tempObj != null) {
            PropertyUtils.copyProperties(aSysRoleModuleRelate, tempObj);
        }
    }

    /**
     * Batch Update Datas
     * @param aSysRoleModuleRelates[]
     * @throws Exception
     */
    public void batchUpdate(SysRoleModuleRelate[] aSysRoleModuleRelates)
        throws Exception {
        super.doBatchUpdate(aSysRoleModuleRelates);
    }

    /**
         * Update Data By Condictions
         * @param aSysRoleModuleRelate
         * @param aValueCriteria
         * @param aTransaction
         * @throws Exception
         */
    public void update(SysRoleModuleRelate aSysRoleModuleRelate,
        SysRoleModuleRelateDAOQueryBean aQueryBean) throws Exception {
        super.doUpdateByQuery(aSysRoleModuleRelate, aQueryBean);
    }

    /**
     * Update Data By Condictions
     * @param aQueryBean
     * @throws Exception
     */
    public void update(SysRoleModuleRelateDAOQueryBean aQueryBean)
        throws Exception {
        super.doUpdateByQuery(aQueryBean);
    }

    protected void checkNullValue(SysRoleModuleRelate aSysRoleModuleRelate)
        throws Exception {
        if (aSysRoleModuleRelate.getDomainCode() == null) {
            throw new Exception(
                "The SysRoleModuleRelate.domainCode value is not allow NULL");
        }

        if (aSysRoleModuleRelate.getModuleCode() == null) {
            throw new Exception(
                "The SysRoleModuleRelate.moduleCode value is not allow NULL");
        }

        if (aSysRoleModuleRelate.getRemarks() == null) {
            throw new Exception(
                "The SysRoleModuleRelate.remarks value is not allow NULL");
        }

        if (aSysRoleModuleRelate.getStatus() == null) {
            throw new Exception(
                "The SysRoleModuleRelate.status value is not allow NULL");
        }
    }

    /**
     * Get Data By ID
     * @param  final long id         * @return  ${businessObject.name}
     * @throws Exception
     */
    public SysRoleModuleRelate findById(final long id)
        throws Exception {
        SysRoleModuleRelateDAOQueryBean queryBean = new SysRoleModuleRelateDAOQueryBean();

        SysRoleModuleRelateDAOQueryBean.Criteria criteria = queryBean.createCriteria();

        criteria.andIdEqualTo(id);

        //queryBean.setDistinct(true);
        SysRoleModuleRelate[] SysRoleModuleRelates = query(queryBean);

        if (SysRoleModuleRelates.length == 0) {
            return null;
        } else {
            return SysRoleModuleRelates[0];
        }
    }

    /**
         * Query Data
         * @param queryBean
         * @return SysRoleModuleRelate[]
         * @throws Exception
         */
    public SysRoleModuleRelate[] query(
        SysRoleModuleRelateDAOQueryBean queryBean) throws Exception {
        List result = super.doQuery(queryBean,
                new JdbcSysRoleModuleRelateRowMapper());

        return (SysRoleModuleRelate[]) result.toArray(new SysRoleModuleRelate[result.size()]);
    }

    /**
     * Query ${businessObject.name} Selective
     * @param queryBean
     * @return Map[]
     * @model
     * @throws Exception
     */
    public Map<String, Object>[] querySelective(
        SysRoleModuleRelateDAOQueryBean queryBean) throws Exception {
        if (queryBean.getSelectProperties().isEmpty()) {
            queryBean.addAllSelectProperties();
        }

        return super.doQuerySelective(queryBean);
    }

    /**
     * Query Data Count
     * @param queryBean
     * @return int
     * @throws Exception
     */
    public int queryCount(SysRoleModuleRelateDAOQueryBean queryBean)
        throws Exception {
        return super.doQueryCount(queryBean);
    }

    public void synchronize(SysRoleModuleRelate[] aSysRoleModuleRelates,
        SysRoleModuleRelateDAOQueryBean queryBean) throws Exception {
        daoHelper.synchronize(aSysRoleModuleRelates, queryBean);
    }

    public void synchronize(SysRoleModuleRelate[] aSysRoleModuleRelates,
        SysRoleModuleRelateDAOQueryBean queryBean,
        net.dao.IDataAccessInterface.ISynchronizeCallback<SysRoleModuleRelate> callBack)
        throws Exception {
        daoHelper.synchronize(aSysRoleModuleRelates, queryBean, callBack);
    }

    public void setSysModuleDao(
        com.ourteam.system.dao.ISysModuleDAO SysModuleDao) {
        this.SysModuleDao = (com.ourteam.system.dao.impl.AbstractSysModuleDAOJdbcImpl) SysModuleDao;
    }

    /**
     * Query Related SysModule
    * @param queryBean
     * @throws Exception
     */
    public com.ourteam.system.dao.SysModule[] querySysModule(
        SysRoleModuleRelateDAOQueryBean queryBean) throws Exception {
        StringBuffer joinSQL = new StringBuffer();

        joinSQL.append(" LEFT JOIN ").append(EntityName).append(" ON ( ");

        joinSQL.append(com.ourteam.system.dao.ISysModuleDAO.Id).append(" = ")
               .append(ModuleId);

        joinSQL.append(" ) ");

        String entityName = com.ourteam.system.dao.impl.SysModuleDAO.EntityName +
            " ref_SysModule";

        String[] entityFields = com.ourteam.system.dao.impl.SysModuleDAO.ENTITY_FIELDS;

        String[] entityProperties = com.ourteam.system.dao.impl.SysModuleDAO.ENTITY_PROPERTIES;

        List list = SysModuleDao.doQuery(entityName, entityFields,
                entityProperties, queryBean, joinSQL.toString(),
                new com.ourteam.system.dao.impl.SysModuleDAO.JdbcSysModuleRowMapper());

        return (com.ourteam.system.dao.SysModule[]) list.toArray(new com.ourteam.system.dao.SysModule[list.size()]);
    }

    /**
     * Query Related SysModule Selective
     * @param queryBean
     * @return Map[]
     * @model
     * @throws Exception
     */
    public Map<String, Object>[] querySysModuleSelective(
        SysRoleModuleRelateDAOQueryBean queryBean) throws Exception {
        if (queryBean.getSelectProperties().isEmpty()) {
            queryBean.addSelectProperty(com.ourteam.system.dao.ISysModuleDAO.Id,
                "id");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysModuleDAO.ModuleCode,
                "moduleCode");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysModuleDAO.ModuleName,
                "moduleName");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysModuleDAO.ParentModuleId,
                "parentModuleId");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysModuleDAO.Remarks,
                "remarks");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysModuleDAO.Status,
                "status");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysModuleDAO.DomainId,
                "domainId");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysModuleDAO.ModuleIcon,
                "moduleIcon");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysModuleDAO.SortIndex,
                "sortIndex");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysModuleDAO.ModuleIconContent,
                "moduleIconContent");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysModuleDAO.ModuleType,
                "moduleType");
        }

        StringBuffer joinSQL = new StringBuffer();

        joinSQL.append(" LEFT JOIN ").append(EntityName).append(" ON ( ");

        joinSQL.append(com.ourteam.system.dao.ISysModuleDAO.Id).append(" = ")
               .append(ModuleId);

        joinSQL.append(" ) ");

        String entityName = com.ourteam.system.dao.impl.SysModuleDAO.EntityName +
            " ref_SysModule";

        return SysModuleDao.doQuerySelective(entityName, queryBean,
            joinSQL.toString());
    }

    /**
     * Update Related SysModule
     * @param aSysModule
     * @param aQueryBean
     * @model
     * @throws Exception
     */
    public void updateSysModule(com.ourteam.system.dao.SysModule aSysModule,
        SysRoleModuleRelateDAOQueryBean aQueryBean) throws Exception {
        StringBuffer joinSQL = new StringBuffer();

        joinSQL.append(" LEFT JOIN ").append(EntityName).append(" ON ( ");

        joinSQL.append(com.ourteam.system.dao.ISysModuleDAO.Id).append(" = ")
               .append(ModuleId);

        joinSQL.append(" ) ");

        String entityName = com.ourteam.system.dao.impl.SysModuleDAO.EntityName +
            " ref_SysModule";

        String[] entityFields = com.ourteam.system.dao.impl.SysModuleDAO.ENTITY_FIELDS;

        String[] entityProperties = com.ourteam.system.dao.impl.SysModuleDAO.ENTITY_PROPERTIES;

        SysModuleDao.doUpdateByQuery(entityName, entityFields,
            entityProperties, joinSQL.toString(), aSysModule, aQueryBean);
    }

    /**
     * Delete Related SysModule
     * @param aQueryBean
     * @model
     * @throws Exception
     */
    public void deleteSysModule(SysRoleModuleRelateDAOQueryBean aQueryBean)
        throws Exception {
        StringBuffer joinSQL = new StringBuffer();

        joinSQL.append(" LEFT JOIN ").append(EntityName).append(" ON ( ");

        joinSQL.append(com.ourteam.system.dao.ISysModuleDAO.Id).append(" = ")
               .append(ModuleId);

        joinSQL.append(" ) ");

        String entityName = com.ourteam.system.dao.impl.SysModuleDAO.EntityName; // + " ref_SysModule";

        SysModuleDao.doDeleteByQuery(entityName, joinSQL.toString(), aQueryBean);
    }

    public void setSysRoleDao(com.ourteam.system.dao.ISysRoleDAO SysRoleDao) {
        this.SysRoleDao = (com.ourteam.system.dao.impl.AbstractSysRoleDAOJdbcImpl) SysRoleDao;
    }

    /**
     * Query Related SysRole
    * @param queryBean
     * @throws Exception
     */
    public com.ourteam.system.dao.SysRole[] querySysRole(
        SysRoleModuleRelateDAOQueryBean queryBean) throws Exception {
        StringBuffer joinSQL = new StringBuffer();

        joinSQL.append(" LEFT JOIN ").append(EntityName).append(" ON ( ");

        joinSQL.append(com.ourteam.system.dao.ISysRoleDAO.Id).append(" = ")
               .append(RoleId);

        joinSQL.append(" ) ");

        String entityName = com.ourteam.system.dao.impl.SysRoleDAO.EntityName +
            " ref_SysRole";

        String[] entityFields = com.ourteam.system.dao.impl.SysRoleDAO.ENTITY_FIELDS;

        String[] entityProperties = com.ourteam.system.dao.impl.SysRoleDAO.ENTITY_PROPERTIES;

        List list = SysRoleDao.doQuery(entityName, entityFields,
                entityProperties, queryBean, joinSQL.toString(),
                new com.ourteam.system.dao.impl.SysRoleDAO.JdbcSysRoleRowMapper());

        return (com.ourteam.system.dao.SysRole[]) list.toArray(new com.ourteam.system.dao.SysRole[list.size()]);
    }

    /**
     * Query Related SysRole Selective
     * @param queryBean
     * @return Map[]
     * @model
     * @throws Exception
     */
    public Map<String, Object>[] querySysRoleSelective(
        SysRoleModuleRelateDAOQueryBean queryBean) throws Exception {
        if (queryBean.getSelectProperties().isEmpty()) {
            queryBean.addSelectProperty(com.ourteam.system.dao.ISysRoleDAO.Id,
                "id");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysRoleDAO.DomainId,
                "domainId");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysRoleDAO.Remarks,
                "remarks");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysRoleDAO.RoleCode,
                "roleCode");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysRoleDAO.RoleName,
                "roleName");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysRoleDAO.RoleType,
                "roleType");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysRoleDAO.Status,
                "status");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysRoleDAO.DefaultFlag,
                "defaultFlag");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysRoleDAO.ModifyTime,
                "modifyTime");

            queryBean.addSelectProperty(com.ourteam.system.dao.ISysRoleDAO.OperatorId,
                "operatorId");
        }

        StringBuffer joinSQL = new StringBuffer();

        joinSQL.append(" LEFT JOIN ").append(EntityName).append(" ON ( ");

        joinSQL.append(com.ourteam.system.dao.ISysRoleDAO.Id).append(" = ")
               .append(RoleId);

        joinSQL.append(" ) ");

        String entityName = com.ourteam.system.dao.impl.SysRoleDAO.EntityName +
            " ref_SysRole";

        return SysRoleDao.doQuerySelective(entityName, queryBean,
            joinSQL.toString());
    }

    /**
     * Update Related SysRole
     * @param aSysRole
     * @param aQueryBean
     * @model
     * @throws Exception
     */
    public void updateSysRole(com.ourteam.system.dao.SysRole aSysRole,
        SysRoleModuleRelateDAOQueryBean aQueryBean) throws Exception {
        StringBuffer joinSQL = new StringBuffer();

        joinSQL.append(" LEFT JOIN ").append(EntityName).append(" ON ( ");

        joinSQL.append(com.ourteam.system.dao.ISysRoleDAO.Id).append(" = ")
               .append(RoleId);

        joinSQL.append(" ) ");

        String entityName = com.ourteam.system.dao.impl.SysRoleDAO.EntityName +
            " ref_SysRole";

        String[] entityFields = com.ourteam.system.dao.impl.SysRoleDAO.ENTITY_FIELDS;

        String[] entityProperties = com.ourteam.system.dao.impl.SysRoleDAO.ENTITY_PROPERTIES;

        SysRoleDao.doUpdateByQuery(entityName, entityFields, entityProperties,
            joinSQL.toString(), aSysRole, aQueryBean);
    }

    /**
     * Delete Related SysRole
     * @param aQueryBean
     * @model
     * @throws Exception
     */
    public void deleteSysRole(SysRoleModuleRelateDAOQueryBean aQueryBean)
        throws Exception {
        StringBuffer joinSQL = new StringBuffer();

        joinSQL.append(" LEFT JOIN ").append(EntityName).append(" ON ( ");

        joinSQL.append(com.ourteam.system.dao.ISysRoleDAO.Id).append(" = ")
               .append(RoleId);

        joinSQL.append(" ) ");

        String entityName = com.ourteam.system.dao.impl.SysRoleDAO.EntityName; // + " ref_SysRole";

        SysRoleDao.doDeleteByQuery(entityName, joinSQL.toString(), aQueryBean);
    }

    public static class JdbcSysRoleModuleRelateRowMapper implements RowMapper<SysRoleModuleRelate> {
        public SysRoleModuleRelate mapRow(ResultSet resultSet, int arg1)
            throws SQLException {
            SysRoleModuleRelate object = new SysRoleModuleRelate();

            int columnIndex = 1;

            int __dataType;

            try {
                Object id = null;

                id = resultSet.getObject(columnIndex++);

                object.setIdNull(resultSet.getBoolean(columnIndex++));

                if (id != null) {
                    setBeanValue(object, _DataObjectProperty.Id, id);
                }

                Object moduleId = null;

                moduleId = resultSet.getObject(columnIndex++);

                object.setModuleIdNull(resultSet.getBoolean(columnIndex++));

                if (moduleId != null) {
                    setBeanValue(object, _DataObjectProperty.ModuleId, moduleId);
                }

                Object remarks = null;

                remarks = resultSet.getObject(columnIndex++);

                object.setRemarksNull(resultSet.getBoolean(columnIndex++));

                if (remarks != null) {
                    setBeanValue(object, _DataObjectProperty.Remarks, remarks);
                }

                Object roleId = null;

                roleId = resultSet.getObject(columnIndex++);

                object.setRoleIdNull(resultSet.getBoolean(columnIndex++));

                if (roleId != null) {
                    setBeanValue(object, _DataObjectProperty.RoleId, roleId);
                }

                Object status = null;

                status = resultSet.getObject(columnIndex++);

                object.setStatusNull(resultSet.getBoolean(columnIndex++));

                if (status != null) {
                    setBeanValue(object, _DataObjectProperty.Status, status);
                }

                Object parentModuleId = null;

                parentModuleId = resultSet.getObject(columnIndex++);

                object.setParentModuleIdNull(resultSet.getBoolean(columnIndex++));

                if (parentModuleId != null) {
                    setBeanValue(object, _DataObjectProperty.ParentModuleId,
                        parentModuleId);
                }

                Object domainId = null;

                domainId = resultSet.getObject(columnIndex++);

                object.setDomainIdNull(resultSet.getBoolean(columnIndex++));

                if (domainId != null) {
                    setBeanValue(object, _DataObjectProperty.DomainId, domainId);
                }

                Object moduleSortIndex = null;

                moduleSortIndex = resultSet.getObject(columnIndex++);

                object.setModuleSortIndexNull(resultSet.getBoolean(
                        columnIndex++));

                if (moduleSortIndex != null) {
                    setBeanValue(object, _DataObjectProperty.ModuleSortIndex,
                        moduleSortIndex);
                }

                Object moduleCode = null;

                moduleCode = resultSet.getObject(columnIndex++);

                object.setModuleCodeNull(resultSet.getBoolean(columnIndex++));

                if (moduleCode != null) {
                    setBeanValue(object, _DataObjectProperty.ModuleCode,
                        moduleCode);
                }

                Object domainCode = null;

                domainCode = resultSet.getObject(columnIndex++);

                object.setDomainCodeNull(resultSet.getBoolean(columnIndex++));

                if (domainCode != null) {
                    setBeanValue(object, _DataObjectProperty.DomainCode,
                        domainCode);
                }

                return object;
            } catch (Exception e) {
                throw new SQLException(e.getMessage());
            }
        }
    }
}
